$(function(){


	//axios本版本不支持jsonp 自己拓展一个
    axios.jsonp = (url) => {
        if(!url){
            console.error('Axios.JSONP 至少需要一个url参数!')
            return;
        }
        return new Promise((resolve,reject) => {
            window.jsonCallBack =(result) => {
                resolve(result)
            }
            var JSONP=document.createElement("script");
            JSONP.type="text/javascript";
            JSONP.src=`${url}?callback=jsonCallBack`;
            document.getElementsByTagName("head")[0].appendChild(JSONP);
            setTimeout(() => {
                document.getElementsByTagName("head")[0].removeChild(JSONP)
            },500)
        })
    }
    var vm = new Vue({
        el:'.lists',
        data:{
            lists: [],
            search:"",
            domain:"https://andy168.gitee.io/andyimg/d163_net/"
        },
        
        mounted(){
                axios.jsonp('data/data.js')
                .then(res => {
                    console.log(res); 
                    this.lists =res.lists;
                }                    )
                .catch(err => console.log(err))
                
                

        },
        methods: {
            
        }
        
    })
	
})